package com.ych.SDK.alibaba.ossSDK.entity;

import com.ych.SDK.alibaba.ossSDK.config.AliOssConfig;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * Author: Usopp.tsui
 * Date: 2021/1/20
 * Time: 13:50
 * Description:
 */
@Data
public class AliOssPublicEntity {

    private String endpoint;

    private String accessKeyId;

    private String accessKeySecret;

    private String bucketName;

    private String objectKey;

    public static AliOssPublicEntity build(String objectKey) {
        AliOssPublicEntity entity = new AliOssPublicEntity();
        entity.setEndpoint(AliOssConfig.endpoint);
        entity.setAccessKeyId(AliOssConfig.accessKeyId);
        entity.setAccessKeySecret(AliOssConfig.accessKeySecret);
        entity.setBucketName(AliOssConfig.bucketName);
        entity.setObjectKey(objectKey);
        return entity;
    }
}
